#
# Copyright 2018, Data61, CSIRO (ABN 41 687 119 230)
#
# SPDX-License-Identifier: BSD-2-Clause
#

cmake_minimum_required(VERSION 3.7.2)

project(rumprun_pthreads C)

includeGlobalComponents()

include(${CMAKE_CURRENT_LIST_DIR}/../rumprun_common.cmake)

DeclareExternalRumprunProject(
    rump_pthreads_external ${CMAKE_CURRENT_LIST_DIR}/components/pthreads bin/pthreads
)

DeclareRumprunCAmkESComponent(
    rumprun_pthreads
    POSIX_BIN
    ${CMAKE_CURRENT_BINARY_DIR}/bin/pthreads
    BAKE_CONFIG
    sel4_generic
)

DeclareCAmkESRootserver(rumprun_pthreads.camkes CPP_INCLUDES ${CAMKES_RUMPRUN_PATH})
add_simulate_test(
    [=[wait_for "Waited and joined with 3 threads. Final value of count = 145. Done"]=]
)
